#!/bin/bash

cd ~/server-tools/ambition/stacks
git pull

read -p "aid download? [Y/n] " response
if [[ "$response" =~ ^([nN][oO]|[nN])$ ]]; then
    echo "NOT download aid."
else
    bash ../aid_download.sh
fi

read -p "docker login aliyun vpc"
docker login registry.cn-zhangjiakou.aliyuncs.com

read -p "node-exporter"
cd node-exporter
bash get-image.sh
# bash ~/server-tools/common/backres/aid-extract.sh
# if [ ! -e /aid/caddy ]; then
#     bash get-permissions.sh
# fi
docker compose up -d
cd ..

read -p "seafile"
cd seafile
bash get-image.sh
bash ~/server-tools/common/backres/aid-extract.sh
# if [ ! -e /aid/frps ]; then
#     bash get-permissions.sh
# fi
docker compose up -d
cd ..

echo "Docker deploy finish!"
# cd ~
